<template>
    <div id="AsnDetail">
        <div class="detail">
            <component :inputData="detailData" :is="currentComponent" ref=comRef></component>
        </div>
    </div>

</template>

<script>
import navMenu from "commons/NavMenu";
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "Detail",
    mixins: [baseMixin],
    data() {
        return {
            newFlag: false,
            selectData: {},
            detailData: {},
            detailNav: "1",
            componentConfig: [
                {
                    name: "PickDetail",
                    label: this.$t('common.info'),
                    component: () => import('./page/PickDetail.vue')
                }
            ]
        }
    },
    computed: {
        currentComponent() {
            return this.componentConfig[this.detailNav - 1].component;
        }
    },
    methods: {
        setMentActive(key) {
            this.detailNav = key;
        },
    },
    mounted() {
        this.newFlag = this.$store.state.newFlag
        if (Object.keys(this.$store.state.skip).length !== 0) {
            let data = this.$store.state.skip;
            this.detailData = data.detail;
            this.detailNav = data.detailNav;
        } else if (this.newFlag) {
            this.detailData = {
                storerkey:"",
                secondno:"",
                loc:"",
                sku:"",
                firstno:"",
            }
        } else {
            this.detailData = this.$store.state.routeData;
        }

    },
    components: {
        "v-navMenu": navMenu,
    },

}
</script>

<style scoped>
</style>
